<template>
  <div class="bigbox">
   <GoodsDetailHeader class="header"/>

    <div class="box">
      <Banner class="banner" />
      <GoodsDetailContent />
      <LookLook />
    </div>

    <DetailFooter class="footer" />
  </div>
</template>

<script>
import LookLook from "./son-components/LookLook.vue";
import DetailFooter from "./GoodsList-file/DetailFooter.vue";
import GoodsDetailContent from "./GoodsList-file/GoodsDetailContent.vue";
import Banner from "./GoodsDetails/Banner.vue";
import axios from "axios";
import { Toast } from "vant";
import GoodsDetailHeader from './GoodsDetails/GoodsDetailHeader.vue';
export default {
  name: "GoodsDetail",
  components: {
    LookLook,
    Banner,
    DetailFooter,
    GoodsDetailContent,
    GoodsDetailHeader
  },
  data() {
    return {
      showPopover: false,
      actions: [{ text: "首页" }, { text: "消息通知" }, { text: "收藏夹" }],
    };
  },
  methods: {
    
    
    toShoppingCar() {
      this.$router.push("/Cart");
    },
    addShoppingCar() {
      this.show = true;
    },
    collection() {},
    onSelect(action, number) {
      // console.log(this,"this"),
      console.log(action, number);
      Toast(action.text);
      if (number == 0) {
        this.$router.push("/Home");
      } else if (number == 1) {
        this.$router.push("/Goods/Information");
      } else {
        this.$router.push("/Goods/Collection");
      }
    },
  },
  created() {
    console.log("this.$route", this.$route.query.id); //匹配到当前路由对象；
    axios({
      // url: "/goods?type1=" + this.$route.query.type,
      url: "/goods?id=" + this.$route.query.id,
    }).then((res) => {
      console.log(res.data);
      this.goodsinfos = res.data[0];
      // console.log(res.goodsinfos);
    });
    // axios({
    //   url: "/goods?type1=redmi&type4=show"
    // }).then((res) => {
    //   // console.log(res);
    //   this.goods = res.data;
    //  this.titleimg=this.goods[0].titleimg;
    //   console.log(this.goods[0].titleimg);
    // });
  },
};
</script>

<style scoped>
@import url(../assets/iconfont2/iconfont.css);

.header {
position: fixed;
  top: 0;
  z-index: 99;
}
.box {
  overflow-y: auto;
}
.box .head .van-popover__wrapper {
  display: inline-block;
  position: relative;
  z-index: 99;
  background-color: white;
}

.down-box:active {
  display: block;
}
.down-box p {
  height: 0.2rem;
  width: 0.6rem;
  font-size: 0.1rem;
}
.footer {
  position: fixed;
  bottom: 0rem;
  left: 0rem;
}
</style>
